Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grt: getCost refactor and mazeRouteMSMD relax grids refactor #5906

Conversation

joaomai
Copy link
Contributor

@joaomai joaomai commented Oct 9, 2024

getCost function refactoring to remove the need of checking if the cost was already calculated for a given position.

relaxAdjacent and updateAdjacent were made as lambdas since both need to access and modify local variables to the mazeRouteMSMD function.

When relaxing the left grid the cost was stored using float, when the other directions were using double. The change to double caused changes in metrics such as total usage and via count for some tests. Similarly, both cost tables were using double while getCost returned a float, which was updated to use double too.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/grt/src/fastroute/include/FastRoute.h Outdated Show resolved Hide resolved
João Mai added 2 commits October 9, 2024 17:41
Signed-off-by: João Mai <[email protected]>
Signed-off-by: João Mai <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 9, 2024

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

github-actions bot commented Oct 9, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

github-actions bot commented Oct 9, 2024

clang-tidy review says "All clean, LGTM! 👍"

: logis_cof(logis_cof),
cost_height(cost_height),
slope(slope),
cost_type(cost_type)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to understand what each cost type means and change it from int to an enum class, with descritive names. Today we only compare with numbers, which is very unclear.

const float cost_height,
const int slope,
const int cost_type)
: logis_cof(logis_cof),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think logis_cof could be renamed to something clearer.

const int slope,
const int capacity,
const int cost_type)
double FastRouteCore::getCost(const int i,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter i could have a more descriptive name. Looking at the usage of this functions, the code is passing a pos, but it doesn't seem to be a position relative to the grid.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably a position related to the heap.

src/grt/src/fastroute/src/maze.cpp Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/grt/src/fastroute/src/FastRoute.cpp Outdated Show resolved Hide resolved
Signed-off-by: João Mai <[email protected]>
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus
Copy link
Collaborator

@joaomai The changes look good, but you will need to update the metrics for the failing designs in the secure-ci. Only then we can merge this PR.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

conflicts to resolve

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus merged commit 92d9433 into The-OpenROAD-Project:master Oct 18, 2024
10 checks passed
@joaomai joaomai deleted the fastroute-refactor-mazeRouteMSMD branch October 19, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants